﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Product.Master" Inherits="System.Web.Mvc.ViewPage<ProductSearchModels>" %>
<%@ Import Namespace="SDT.Lib.Paging" %>
<%@ Import Namespace="SDT.Site.ViewModels" %>
<%@ Import Namespace="SDT.Lib.Helpers" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
 <%if (Model.ProductType != null)
   {
       Response.Write(Html.Encode(Model.ProductType.Name));
   } %>
   
   <%if (Model.Category != null)
   {
       Response.Write(" "+Html.Encode(Model.Category.Name));
   } %>
   <%if (Model.ProductHoliday != null)
   {
       Response.Write(" " + Html.Encode(Model.ProductHoliday.Name));
   } %>
   <%if (Model.Tag != null)
   {
       Response.Write(" " + Html.Encode(Model.Tag.Keyword));
   } %>
 quà tặng, quà sinh nhật, quà cưới, tân gia, gói quà, tặng quà muaqua.vn
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="PathContent" runat="server">
    <% Html.RenderPartial("~/Views/Product/Path.ascx", Model); %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div class="content">
    <form method="post" id="siteForm" name="siteForm" action="">
        <div class="toolbar">
            Sắp xếp theo: <%=Html.DropDownList("ddlOrderBy", new SelectList(Model.OrderBy, "key", "value", Model.OrderID.HasValue ? "" + Model.OrderID.Value : ""), "-- Chọn -- ", new { onchange = "document.siteForm.submit();", style = "width:140px" })%>
            <label>Xem</label>
            <%
                int[] pageSizeList = { 6, 12, 15, 30, 60, 210 };
            %>
            <%= Html.DropDownList("pageSize", new SelectList(pageSizeList, Model.Products.PageSize), new { onchange = "document.siteForm.submit();" })%>
            sản phẩm / trang 
        </div>
        <div id="list_sfam">
	    <ul>
    	    <%foreach (var item in Model.Products)
           { %>
    	    <li>
       	        <div class="bg_img">
       	            <a href="/product/details/<%=item.ID %>/<%=Html.ToUrlFriendly(item.Name)%>">
                        <% string imgPath = (item.ImagePath != null && item.ImagePath != string.Empty) ? SDT.Lib.Common.Utils.GenThumbnail(item.ID, 187, 187, item.ImagePath, Model.ImagePath, Model.ImageUrl) : SDT.Lib.Common.Globals.DefaultLogo; %>
                        <img src="<%=imgPath %>" title="<%=item.Name %>" alt="<%=item.Name %>" width="187px" height="187px"" />
                     </a>
       	        </div>
                <h3><a href="/product/details/<%=item.ID %>/<%=Html.ToUrlFriendly(item.Name)%>"><%=Html.Encode(item.Name) %></a></h3>
                <div>
                    <span class="t_red"><strong><%=string.Format("{0:0,0}",item.UnitPrice) %> ₫</strong></span>
                    <a href="/product/details/<%=item.ID %>/<%=Html.ToUrlFriendly(item.Name)%>"><img src="/Images/mq/btn_detail.png" title="<%=item.Name %>" alt="<%=item.Name %>" style="vertical-align:middle" /></a>
                </div>
            </li>
            <%} %>
        </ul>
    </div>
    </form>
    <div class="clear">&nbsp;</div>
    <div class="pagebarUTH f_r">
        Trang <%= Model.Products.PageNumber%>/<%= Model.Products.PageCount%>
        <%= Html.Pager(Model.Products.PageSize, Model.Products.PageNumber, Model.Products.TotalItemCount, new
                {
                    id = Model.TypeID,
                    catid = Model.CategoryID,
                    holidayid = Model.HolidayID,
                    eventid = Model.EventID,
                    priceid = Model.PriceID,
                    timeid = Model.TimeID,
                    pageSize = Model.Products.PageSize,                        
                    key = Model.Keyword
                })%>
     </div>	
</div>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="RightContent" runat="server">
<% Html.RenderAction("GetCart", "Product", new { title = "Thanh toán", viewName = "Cart" }); %>
<div class="clear"></div>
<div class="bg_choice"><h4>Lựa chọn mua sắm</h4></div>
<div class="pad">
  <% Html.RenderPartial("~/Views/Product/Type.ascx", Model); %>
  <% Html.RenderPartial("~/Views/Product/Holiday.ascx", Model); %>
  <% Html.RenderPartial("~/Views/Product/Price.ascx", Model); %>
  <% Html.RenderPartial("~/Views/Product/Category.ascx", Model); %>
</div>
<% Html.RenderAction("Lasted", "Product", new { typeid = 0, catid = 0, holidayid = 0, number = 12, hotYN = 0, newYN = 0, saleYN = 1, promoYN = 0, order = "ID", orderDir = "desc", title = "Sản phẩm giảm giá", viewName = "Sale" }); %>
<% Html.RenderAction("GetTags", "Product", new { typeid = Model.TypeID, catid = Model.CategoryID, holidayid = Model.HolidayID, eventid = Model.EventID, number = 20, order = "ID", orderDir = "desc", title = "Top từ khóa", viewName = "Tag" }); %>
<div align="center"><a href="#"><img src="/images/mq/price.png" /></a></div>
</asp:Content>
